<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <!-- ?? oldAttr.xml -->
    
    <xsl:template match="/">

        <xsl:for-each select="root/body/object/record/attribute">

        <xsl:element name="attribute">

        <xsl:attribute name="name">
            <xsl:choose>
                <xsl:when test='@name = "voucher_no"'>voucher_code</xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="@name"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:attribute>

            <xsl:attribute name="fieldtype">
                <xsl:value-of select="@fieldtype"/>
            </xsl:attribute>

            <xsl:attribute name="description">
                <xsl:value-of select="@description"/>
            </xsl:attribute>

            <xsl:attribute name="value">
                <xsl:value-of select="."/>
            </xsl:attribute>

            <!--<xsl:value-of select="."/>-->

        </xsl:element>

        </xsl:for-each>




    </xsl:template>

</xsl:stylesheet>